<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
    <title>{{ config('app.name', '') }}</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <!-- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="keywords" content="{{ env('APP_KEYWORDS', '') }}">
    <meta name="description" content="{{ env('APP_DESCRIPTION', '') }}">
    <!-- CSRF Token -->
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <!-- Styles -->
    <link href="{{ asset('css/app.css') }}" rel="stylesheet" type="text/css" />
    <link href="{{ asset('css/style.css') }}" rel="stylesheet" type="text/css" />
    <link href="{{ asset('js/layui/css/layui.css') }}" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="{{ asset('js/jquery-1.11.2.min.js') }}"></script>
    <script type="text/javascript" src="{{ asset('js/layer/layer.js') }}"></script>
    <script type="text/javascript" src="{{ asset('js/layui/layui.js') }}"></script>
    <script type="text/javascript" src="{{ asset('js/main.js') }}"></script>
    <link rel="shortcut icon" href="favicon.ico" />
    <base target="_self">

    <style>
        .qiang-btn {
            display: inline-block;
            padding: 0 15px;
            background-color: red;
            color: #fff;
            height: 22px;
            line-height: 22px;
            text-align: center;
            border-radius: 3px;
        }
    </style>
</head>
    <body>
        <div class="table-responsive">
            <table class="table table-sm table-hover text-center">
                <thead>
                <tr>
                    <th style="min-width:135px;">游戏名称</th>
                    <th style="min-width:135px;">领取区服</th>
                    <th style="min-width:100px;">领取账号</th>
                    <th style="min-width:110px;">领取时间</th>
                    <th style="min-width:135px;">充值状态</th>
                    <th style="min-width:110px;">处理时间</th>
                    <th style="min-width:110px;">充值截图</th>
                </tr>
                </thead>
                <tbody>
                @foreach($logs as $key => $data)
                    <tr>
                        <td style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{$data->game_name}}</td>
                        <td style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{$data->server_name}}</td>
                        <td style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{substr($data->game_num,0,1) . '****' . substr($data->game_num,-1,1)}}</td>
                        <td style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{date("Y-m-d H:i:s",$data->create_time)}}</td>
                        <td style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{!!echoGetLogErr($data)!!}</td>
                        <td style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{$data->status == 2 ? date("Y-m-d H:i:s",$data->recharge_time) : '-'}}</td>
                        <td style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
                            @if ($data->img)
                            <a href="{{$data->img}}" target="_blank">点击查看</a>
                            @else
                                <!-- 如果异常且是当前用户，则可重新提交数据 -->
                                @if ($data->status == 3 && $data->user_id == $user_id)
                                    <a href="javascript:void(0);" class="qiang-btn" onclick="showPage({{$data->id}})"> 重新提交 </a>
                                @else
                                暂无图片
                                @endif
                            @endif
                        </td>
                    </tr>
                @endforeach
                </tbody>
            </table>
        </div>
    </body>

<script>
    function showPage(id) {
        layer.open({
            type: 2,
            title: "重新提交",
            content: "{{route('showReCommitGetLog', '')}}/"+id,
            area: ['500px', '300px']
        })
    }


</script>
</html>
